import { http } from "@/utils/http"
import type { BannerItem, CategoryItem, GuessItem, HotItem } from "@/types/home";
import type { PageResult, PageParams } from "@/types/global";


/**
 * 
 * @returns 首页广告区域
 */
export const getHomeBannerApi = (distributionSite = 1) => {
    return http<BannerItem>({
        method: "GET",
        url: "/home/banner",
        data: {
            distributionSite
        },
    })
}

/**
 * 
 * @returns 前台分类
 */
export const getHomeCategoryAPI = () => {
    return http<CategoryItem[]>({
        method: "GET",
        url: "/home/category/mutli"
    })
}

export const getHotItemAPI = () => {
    return http<HotItem[]>({
        method: 'GET',
        url: '/home/hot/mutli'
    })
}

export const getHomeGoodsGuessLikeAPI = (params: PageParams) => {
    return http<PageResult<GuessItem>>({
        method: 'GET',
        url: '/home/goods/guessLike',
        data: params
    })
}

